package com.probox.modules.controller.common;

import com.probox.common.core.web.controller.BaseController;
import com.probox.common.core.web.domain.AjaxResult;
import com.probox.common.entity.service.common.SysReginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 地区Controller
 *
 * @author zsy
 * @date 2021-06-02
 */
@RestController
@RequestMapping("/common/sys_regin")
public class SysReginController extends BaseController {
    @Autowired
    private SysReginService sysReginService;

    /**
     * 获取地区数据
     */
    @GetMapping("/getRegion")
    public AjaxResult getRegion() {
        return AjaxResult.success(sysReginService.getRegion());
    }

    /**
     * 获取地区数据
     */
    @GetMapping("/getRegionS")
    public AjaxResult getRegionS() {
        return AjaxResult.success(sysReginService.getRegionS());
    }

    /**
     * 获取省市区code
     */
    @PostMapping("/getReginCode")
    public Long[] getReginCode(@RequestBody String[] labels) {
        return sysReginService.getReginCode(labels);
    }
}
